<template>
  <view class="detailBox">
    <uni-steps
      :options="orderDetails"
      active-color="#F65201"
      direction="column"
    />
  </view>
</template>

<script>
import { findLogistics } from '@/api/order.js'

export default {
  data() {
    return {
      orderDetails: [],
      navbarBackground: {
        background: 'red'
      }
    }
  },
  computed: {},
  onLoad(options) {
    this.getDetails(options.id)
  },
  methods: {
    getDetails(id) {
      uni.showLoading({
        mask: true
      })
      findLogistics({ oid: id })
        .then((res) => {
          let { code, data, msg } = res.data
          if (code == 200) {
            let arr = []
            data.map((item) => {
              arr.push({ title: item.time, desc: item.context })
            })
            this.orderDetails = arr
            console.log(this.orderDetails)
            uni.hideLoading()
          } else {
            uni.hideLoading()
            this.$am_toast.warning(msg)
          }
        })
        .catch((err) => {
          uni.hideLoading()
          this.$am_toast.error('查询失败，请重新尝试！')
        })
    }
  }
}
</script>

<style lang="scss" scoped>
.detailBox {
  box-sizing: border-box;
  padding: 20rpx;
  background: #fff;
  margin-top: 15rpx;
}
/deep/.uni-steps__column-text {
  border: none;
}
</style>
